﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Dos.ORM;

namespace GongXianDCUI.Models
{
    /// <summary>
    /// 实体类Funcitions。(属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Table("Funcitions")]
    [Serializable]
    public partial class Funcitions : Entity
    {
        #region Model
        private int _FunctionId;
        private string _FunctionName;
        private int? _ParentId;
        private string _MenuURL;
        private int? _State;
        private int? _ShowNo;
        private string _ModelPicture = "/content/dianli/images/1.jpg";

        /// <summary>
        /// 
        /// </summary>
        [Field("FunctionId")]
        public int FunctionId
        {
            get { return _FunctionId; }
            set
            {
                this.OnPropertyValueChange("FunctionId");
                this._FunctionId = value;
            }
        }
        /// <summary>
        /// 菜单名称
        /// </summary>
        [Field("FunctionName")]
        public string FunctionName
        {
            get { return _FunctionName; }
            set
            {
                this.OnPropertyValueChange("FunctionName");
                this._FunctionName = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        [Field("ParentId")]
        public int? ParentId
        {
            get { return _ParentId; }
            set
            {
                this.OnPropertyValueChange("ParentId");
                this._ParentId = value;
            }
        }
        /// <summary>
        /// 页面地址
        /// </summary>
        [Field("MenuURL")]
        public string MenuURL
        {
            get { return _MenuURL; }
            set
            {
                this.OnPropertyValueChange("MenuURL");
                this._MenuURL = value;
            }
        }
        /// <summary>
        /// 是否启用
        /// </summary>
        [Field("State")]
        public int? State
        {
            get { return _State; }
            set
            {
                this.OnPropertyValueChange("State");
                this._State = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        [Field("ShowNo")]
        public int? ShowNo
        {
            get { return _ShowNo; }
            set
            {
                this.OnPropertyValueChange("ShowNo");
                this._ShowNo = value;
            }
        }
        /// <summary>
        /// 模块图片
        /// </summary>
        [Field("ModelPicture")]
        public string ModelPicture
        {
            get { return _ModelPicture; }
            set
            {
                this.OnPropertyValueChange("ModelPicture");
                this._ModelPicture = value;
            }
        }
        #endregion

        #region Method
        /// <summary>
        /// 获取实体中的主键列
        /// </summary>
        public override Field[] GetPrimaryKeyFields()
        {
            return new Field[] {
				_.FunctionId,
			};
        }
        /// <summary>
        /// 获取列信息
        /// </summary>
        public override Field[] GetFields()
        {
            return new Field[] {
				_.FunctionId,
				_.FunctionName,
				_.ParentId,
				_.MenuURL,
				_.State,
				_.ShowNo,
				_.ModelPicture,
			};
        }
        /// <summary>
        /// 获取值信息
        /// </summary>
        public override object[] GetValues()
        {
            return new object[] {
				this._FunctionId,
				this._FunctionName,
				this._ParentId,
				this._MenuURL,
				this._State,
				this._ShowNo,
				this._ModelPicture,
			};
        }
        /// <summary>
        /// 是否是v1.10.5.6及以上版本实体。
        /// </summary>
        /// <returns></returns>
        public override bool V1_10_5_6_Plus()
        {
            return true;
        }
        #endregion

        #region _Field
        /// <summary>
        /// 字段信息
        /// </summary>
        public class _
        {
            /// <summary>
            /// * 
            /// </summary>
            public readonly static Field All = new Field("*", "Funcitions");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field FunctionId = new Field("FunctionId", "Funcitions", "");
            /// <summary>
            /// 菜单名称
            /// </summary>
            public readonly static Field FunctionName = new Field("FunctionName", "Funcitions", "菜单名称");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field ParentId = new Field("ParentId", "Funcitions", "");
            /// <summary>
            /// 页面地址
            /// </summary>
            public readonly static Field MenuURL = new Field("MenuURL", "Funcitions", "页面地址");
            /// <summary>
            /// 是否启用
            /// </summary>
            public readonly static Field State = new Field("State", "Funcitions", "是否启用");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field ShowNo = new Field("ShowNo", "Funcitions", "");
            /// <summary>
            /// 模块图片
            /// </summary>
            public readonly static Field ModelPicture = new Field("ModelPicture", "Funcitions", "模块图片");
        }
        #endregion


        #region 自定义

        private string _ChildrenName;
        private List<Funcitions> menulist = new List<Funcitions>();

        /// <summary>
        /// 该节点的子集
        /// </summary>
        public List<Funcitions> Childrens { get { return menulist; } set { menulist = value; } }
        
        /// <summary>
        /// 导航栏，子模块名称
        /// </summary>
        public string ChildrenName { get { return _ChildrenName; } set { _ChildrenName = value; } }

        public int ChildrenID
        {
            get
            {
                return childrenID;
            }

            set
            {
                childrenID = value;
            }
        }

        private int childrenID;

        #endregion

    }

}
